#!/bin/bash


problems=(
    "130. 被围绕的区域"
    "200. 岛屿数量"
    "694. 不同的岛屿数量"
    "695. 岛屿的最大面积"
    "1020. 飞地的数量"
    "1254. 统计封闭岛屿的数目"
    "1905. 统计子岛屿"
)


for prob in "${problems[@]}"; do
    num=$(echo $prob | grep -oE '^[0-9]+')
    title=$(echo $prob | sed "s/$num//g" | xargs)
    # 移除标题中的点号
    title=${title//./}
    filename="LC_${num}_${title// /_}.java"
    cat > $filename <<EOF
package org.labuladong.暴力搜索算法.DFS算法;

/**
 * @Author: qingle
 * @Date: 2024/10/28-16:11
 * @Description: $prob
 * @version: 1.0
 */
public class LC_${num}_${title// /_} {
}
EOF
done